<template>
  <div>
    1
    <button @click="tt">ttt5555</button>
  </div>
</template>

<script>
// 将store/index.js中的状态/方法引入
import { mapMutations, mapState } from "vuex";
export default {
  // 引入公共池的id
  computed: {
    ...mapState(["id"]),
  },

  mounted() {
    // console.log(this.id);
  },
  methods: {
    ...mapMutations(['setId']),
    tt() {
          this.setId(5555)
         console.log(this.id);
      // this.$store.state.id = 555;
    },
  },
  // mounted() {

  // },
};
</script>

<style lang="scss" scoped>
</style>